package com.magenta.maxoptra.dto;

/**
 * Created by IntelliJ IDEA.
 * User: antonn
 * Date: 28-May-2010
 * Time: 16:44:39
 * Project: Maxoptra SM
 */
public class Coordinate {
    private double inDegree;
    private double inRad;

    public Coordinate(double inDegree) {
        this.inDegree = inDegree;
        this.inRad = inDegree * Math.PI / 180;
    }

    public Coordinate(double inRad, boolean radians) {
        if (radians) {
            this.inRad = inRad;
            this.inDegree = inRad * 180 / Math.PI;
        } else {
            this.inDegree = inRad;
            this.inRad = inRad * Math.PI / 180;
        }
    }

    public double toDeg() {
        return inDegree;
    }

    public double toRad() {
        return inRad;
    }
}
